package mock;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionReader;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * @author wx-li
 * @company 希睿科技(www.xraitech.com)
 * @copyright (c) 2018 希睿科技( www.xraitech.com )Inc. All rights reserved.
 * @date 2020/10/16 15:03
 * @since JDK1.8
 */
public class ListLoader {
    public static void main(String[] args) {
        DefaultListableBeanFactory beanRegistry = new DefaultListableBeanFactory();
        BeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanRegistry);
        beanDefinitionReader.loadBeanDefinitions("list.xml");
        Object someBean = ((BeanFactory) beanRegistry).getBean("someBean");
        Object mockDemoObjectList = ((BeanFactory) beanRegistry).getBean("mockDemoObjectList");
        System.out.println(someBean);
        System.out.println(mockDemoObjectList);
    }
}
